module IfItWerent4AR
  module StorageCRUD
    # creates/updates/destroys object in storage

    def create(attributes = nil)
      FileOp::write_to_storage(self) ? self : false
    end

    def update(attributes = nil)
      assign_attributes(attributes) if attributes
      FileOp::update_in_storage(self) ? self : false
    end

    def destroy
      FileOp::destroy_from_storage(self) ? true : false
    end
  end
end
